#include<iostream>
#include<string>
using namespace std;

int main()
{
	string s("hello world!");
	string::reverse_iterator it = s.rbegin();
	//auto it = s.rbgein();
	while (it != s.rend())
	{
		cout << *it << " ";
		++it;
	}
	return 0;
}